package com.ehome.poct.core.dao.mybatis;

import com.ehome.mybatisplus.support.AbstractCrudRepository;
import com.ehome.poct.core.api.dto.report.ConfAnalysisPermissionDTO;
import com.ehome.poct.core.dao.entity.report.ConfAnalysisPermissionDO;
import com.ehome.poct.core.dao.mybatis.mapper.report.ConfAnalysisPermissionMapper;
import com.ehome.poct.core.repository.report.ConfAnalysisPermissionRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

/**
 * 血常规报告解读权限配置RepositoryImpl
 *
 * @author wuyingchao
 * @Date 2022-09-06 09:57
 */
@Repository
@RequiredArgsConstructor
public class ConfAnalysisPermissionRepositoryImpl extends AbstractCrudRepository<ConfAnalysisPermissionDO, ConfAnalysisPermissionDTO> implements ConfAnalysisPermissionRepository {
    private final ConfAnalysisPermissionMapper mapper;

    @Override
    public Boolean hasPermission(String code, Long id) {
        return mapper.selectByClinicId(code, id) != null;
    }
}
